﻿using AgileLabs.Dapper.FluentMap;
using Dapper.FluentMap;
using System;
using System.Collections.Generic;
using System.Text;
using static AgileLabs.Dapper.FluentMap.AgileMapper;

namespace FoucsCareer.EntitiyMap.Dapper
{
    public class MapperInitialize
    {
        private static bool isInitialized = false;
        public static void Initialize()
        {
            if (isInitialized)
                return;
            FluentMapper.Initialize(config =>
            {
               // config.AddMap(new UserMap());

                config.ForAgileMap();

                AgileMapper.SetPropertyResolver(new PropertyResolver());
                AgileMapper.SetColumnNameResolver(new ColumnNameResolver());
                AgileMapper.SetKeyPropertyResolver(new KeyPropertyResolver());
            });
            isInitialized = true;
        }
    }
}
